//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { ElementComponents, ElementComponentsResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooElementComponentsList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<ElementComponentsResponse>(`/uctoo/element_components/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooElementComponents = async (id: string) => {
  return requestClient.get<ElementComponents>(`/uctoo/element_components/${id}`);
};

export const adductooElementComponents = async (data: Partial<ElementComponents>) => {
  return requestClient.post<ElementComponents>('/uctoo/element_components/add', data);
};

export const edituctooElementComponents = async (data: Partial<ElementComponents>) => {
  return requestClient.post<ElementComponents>('/uctoo/element_components/edit', data);
};

export const deleteuctooElementComponents = async (id: string) => {
  return requestClient.post<any>('/uctoo/element_components/del', { id });
};
